part of _;

extension on BindPage {
  Widget _view_item(String title, bool isBind, onTap()) {
    return YListTile(
      title,
      null,
      () => onTap(),
      bgColor: Colors.white,
      right: Row(
        children: [
          Text(isBind ? "已绑定" : "未绑定", style: TextStyle(color: isBind ? YConfig.themeColor : Colors.grey)),
          Icon(Icons.chevron_right, color: Colors.grey),
        ],
      ),
    );
  }

  Widget view_phone() {
    return _view_item("手机号码", model!.isBindPhone, () => controller_showBindPhone());
  }

  Widget view_third() {
    return Column(
      children: [
        _view_item("QQ登录", model!.isBindThirdQQ, () => controller_showBindThird(ShareSDKPlatforms.qq)),
        Divider(height: 1),
        _view_item("微信登录", model!.isBindThirdWeChat, () => controller_showBindThird(ShareSDKPlatforms.wechatSession)),
      ],
    );
  }
}
